<extend name="Public/base"/>
<block name="style">
    <link href="__STATIC__/select2/select2.css" rel="stylesheet" type="text/css"></link>
    <link href="__STATIC__/select2/select2-bootstrap.css" rel="stylesheet" type="text/css"></link>
    <script src="__STATIC__/select2/select2.js"></script>
</block>
<block name="body">
    <!-- 标题 -->
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>
    <ul class="tab-nav nav">

            <li data-tab="tab_wechat" class="current"><a href="javascript:void(0);">微信信息</a></li>

    </ul>
    <div class="tab-content">




            <div id="tab_wechat" class="tab-pane in tab_wechat">
            <table class="table table-striped table-bordered">
                <thead>
                <tr>
                    <td width="20%">列项</td>
                    <td width="80%">值</td>
                </tr>
                </thead>
                <tbody>

                <foreach name="info" key="k" item="item">
                    <tr>
                        <td width="20%">{$k|get_member_key}</td>
                        <switch name="k">
                            <case value="sex">
                                <td width="80%">
                                    <if condition="$item eq 1">男
                                        <elseif condition="$item eq 2"/>
                                        女
                                        <else/>
                                        未知
                                    </if>
                                </td>
                            </case>
                            <case value="uid">
                                <td width="80%">
                                    <notempty name="item">已绑定id：{$item} | {$item|get_nickname}<else />未绑定</notempty>
                                </td>
                            </case>
                            <case value="remark">
                                <td width="80%">
                                    <a href="#" data-name="remark" data-type="text" data-url="{:U('setClientInfo')}" data-pk="{$info.id}" data-title="设置备注" class="editable editable-click remark" style="display: inline; background-color: rgba(0, 0, 0, 0);">{$item}</a>
                                </td>
                            </case>
                            <case value="tags">
                                <td width="80%">
                                    <a href="#" data-name="tagid_list" data-type="select2" data-pk="{$info.id}" data-url="{:U('setClientInfo')}" data-title="设置tags" class="editable editable-click tags" style="display: inline; background-color: rgba(0, 0, 0, 0);">{$item}</a>
                                </td>
                            </case>
                            <case value="birthday">
                                <td width="80%">{$item|date="Y-m-d H:i:s",###}</td>
                            </case>
                            <case value="reg_time">
                                <td width="80%">{$item|date="Y-m-d H:i:s",###}</td>
                            </case>
                            <case value="reg_ip">
                                <td width="80%">
                                    <eq name="item" value="0">未知
                                        <else/>
                                        {$item}
                                    </eq>
                                </td>
                            </case>
                            <case value="last_login_ip">
                                <td width="80%">
                                    <eq name="item" value="0">未知
                                        <else/>
                                        {$item}
                                    </eq>
                                </td>
                            </case>
                            <case value="last_login_time">
                                <td width="80%">{$item|date="Y-m-d H:i:s",###}</td>
                            </case>
                            <case value="status">
                                <td width="80%">{$item|get_status_title}</td>
                            </case>
                            <case value="img">
                                <td width="80%">
                                    <eq name="item" value="0">还没有头像呢。
                                        <else/>
                                        <div class="headimg-pre-item"><img src="__ROOT__{$item|get_cover='path'}"/>
                                        </div>
                                    </eq>
                                </td>
                            </case>
                            <case value="headimgurl">
                                <td width="80%">

                                        <div class="headimg-pre-item"><img src="{$item}"/>
                                        </div>

                                </td>
                            </case>
                            <case value="weibo">
                                <td width="80%"><a href="http://www.weibo.com/{$item}" target="_blank">{$item}</a></td>
                            </case>
                            <default/>
                            <td>{$item}</td>
                        </switch>
                    </tr>
                </foreach>
                </tbody>

            </table>
    </div>
    </div>
    <div class="table">
        <a class="btn submit-btn" href="{:U('updateInfo')}">编辑资料</a>
        <a class="btn btn-return" href="{:U('updateInfo')}">从微信导入</a>
    </div>
</block>

<!-- 加载底部JS -->
<block name="script">

    <script>
        //turn to inline mode
        $.fn.editable.defaults.mode = 'inline';

        var tags = {$allTags};

        $(document).ready(function() {
            $('.tags').editable({
                inputclass: 'input-large',
                select2: {
                    tags: tags,
                    tokenSeparators: [",", " "]
                },
                multiple: true
            });

            $(".remark").editable();
        });

    </script>

    <include file="Public/footjs"/>
</block>